package com.ssm.user.designPattern.strategyPattern.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class PayHandleDemo {

    @Resource
    private PayFactory payFactory;

    public void dealPay(int code) {
        PayHandle payHandle = payFactory.getHandleByCode(code);
        payHandle.dealPay();
    }
}
